package com.shop.cereshop.app.param.wallet;

import com.shop.cereshop.commons.domain.wallet.BuyerWallet;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel(value = "WalletInitResult", description = "钱包初始化结果响应参数")
public class WalletInitResult {

    @ApiModelProperty(value = "是否新建钱包", example = "true", notes = "true-新建钱包 false-已存在钱包，默认值：无")
    private Boolean isNewWallet;

    @ApiModelProperty(value = "钱包信息", notes = "钱包详细信息，默认值：无")
    private BuyerWallet wallet;

    /**
     * 创建新建钱包结果
     */
    public static WalletInitResult newWallet(BuyerWallet wallet) {
        WalletInitResult result = new WalletInitResult();
        result.setIsNewWallet(true);
        result.setWallet(wallet);
        return result;
    }

    /**
     * 创建已存在钱包结果
     */
    public static WalletInitResult existingWallet(BuyerWallet wallet) {
        WalletInitResult result = new WalletInitResult();
        result.setIsNewWallet(false);
        result.setWallet(wallet);
        return result;
    }
}
